#include <gfx/vk/core.h>
#include <gfx/vk/helper.h>

namespace primal
{
	namespace gfx
	{
		using AllPassType = VkRenderPass[RENDERE_PASS_TYPE::MAX_COUNT];

		VkRenderPass create_ui_pass()
		{
			VkRenderPass temp_pass{};
			VKASSERT(dev().CreateRenderPass(&primal::vkx::render_pass_create_info_list.ui, &temp_pass));
			return temp_pass;
		}

		bool init_pass(AllPassType& passes)
		{
			bool res{ true };
			res &= initialize();
			passes[RENDERE_PASS_TYPE::UI] = create_ui_pass();
			res &= passes[RENDERE_PASS_TYPE::UI] != nullptr;
			return res;
		}

		VkRenderPass get_pass(RENDERE_PASS_TYPE type)
		{
			static AllPassType all_pass{};
			static bool is_init_pass{ init_pass(all_pass) };
			return all_pass[type];
		}
	}
}